/*     */ package com.lmpop.trade.tb_intervary;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Tb_intervaryInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Tb_intervaryInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Tb_intervary tb_intervary = new Tb_intervary();
/*  26 */     tb_intervary.setTrade_id(map.getString("trade_id"));
/*  27 */     tb_intervary.setUser_id(map.getString("user_id"));
/*  28 */     tb_intervary.setVary_num(map.getInt("vary_num"));
/*  29 */     tb_intervary.setReason(map.getString("reason"));
/*  30 */     tb_intervary.setTrade_type(map.getString("trade_type"));
/*  31 */     tb_intervary.setIn_date(map.getString("in_date"));
/*  32 */     tb_intervary.setPublish_user_id(map.getString("publish_user_id"));
/*     */ 
/*  34 */     String result_code = "0";
/*     */     try {
/*  36 */       if (map.getInt("vary_num") != 0)
/*  37 */         insert(dbmMgr, tb_intervary);
/*     */     }
/*     */     catch (ApplicationException e) {
/*  40 */       e.printStackTrace();
/*  41 */       result_code = "1";
/*     */     }
/*  43 */     map.setString("result_code", result_code);
/*  44 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Tb_intervary tb_intervary)
/*     */     throws ApplicationException
/*     */   {
/*  53 */     dbmMgr.update("insertTb_intervary", tb_intervary);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  63 */     String pkid_string = map.getString("pkid");
/*  64 */     String result_code = "0";
/*     */     try {
/*  66 */       if (!pkid_string.equals("")) {
/*  67 */         String[] pkStr = pkid_string.split("\\|");
/*  68 */         for (int i = 0; i < pkStr.length; i++) {
/*  69 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  73 */       e.printStackTrace();
/*  74 */       result_code = "1";
/*     */     }
/*  76 */     map.setString("result_code", result_code);
/*  77 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  86 */     dbmMgr.update("deleteTb_intervary", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  95 */     Tb_intervary tb_intervary = new Tb_intervary();
/*  96 */     tb_intervary.setTrade_id(map.getString("trade_id"));
/*  97 */     tb_intervary.setUser_id(map.getString("user_id"));
/*  98 */     tb_intervary.setVary_num(map.getInt("vary_num"));
/*  99 */     tb_intervary.setReason(map.getString("reason"));
/* 100 */     tb_intervary.setTrade_type(map.getString("trade_type"));
/* 101 */     tb_intervary.setIn_date(map.getString("in_date"));
/* 102 */     tb_intervary.setPublish_user_id(map.getString("publish_user_id"));
/*     */ 
/* 104 */     String result_code = "0";
/*     */     try {
/* 106 */       update(dbmMgr, tb_intervary);
/*     */     } catch (ApplicationException e) {
/* 108 */       e.printStackTrace();
/* 109 */       result_code = "1";
/*     */     }
/* 111 */     map.setString("result_code", result_code);
/* 112 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Tb_intervary tb_intervary)
/*     */     throws ApplicationException
/*     */   {
/* 121 */     dbmMgr.update("updateTb_intervary", tb_intervary);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 131 */     Map tb_intervary = (Hashtable)obj;
/*     */ 
/* 133 */     if (start == 0)
/* 134 */       start = 0;
/*     */     else {
/* 136 */       start = (start - 1) * limit;
/*     */     }
/* 138 */     tb_intervary.put("start", Integer.valueOf(start));
/* 139 */     tb_intervary.put("limit", Integer.valueOf(limit));
/*     */ 
/* 141 */     return this.queryList.getList("getListByTb_intervaryPage", tb_intervary);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 152 */     Map tb_intervary = (Hashtable)obj;
/* 153 */     List list = this.queryList.getList("getCountByObjTb_intervary", tb_intervary);
/*     */ 
/* 155 */     int count = 0;
/* 156 */     if ((list != null) && (list.size() > 0)) {
/* 157 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 158 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 159 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 162 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 172 */     return this.queryList.getList("getTb_intervaryByPk", pk);
/*     */   }
/*     */ 
/*     */   public int getTi_personalInternum(String user_id)
/*     */   {
/* 184 */     int inter_num = 0;
/* 185 */     List list = this.queryList.getList("getTi_personalInternumByuserid", user_id);
/* 186 */     if ((list != null) && (list.size() > 0)) {
/* 187 */       Hashtable map = (Hashtable)list.get(0);
/* 188 */       if (map.get("inter_num") != null)
/* 189 */         inter_num = Integer.parseInt(map.get("inter_num").toString());
/*     */     }
/* 191 */     return inter_num;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.tb_intervary.Tb_intervaryInfo
 * JD-Core Version:    0.6.0
 */